from django.db import models

from libs import time_helper


class TableGoods(models.Model):
    class_id = models.IntegerField(blank=True, null=True)
    goods_name = models.CharField(max_length=255, blank=True, null=True)
    usdt_price = models.FloatField(blank=True, null=True)
    power_number = models.FloatField(default=0, blank=True, null=True)
    scount = models.DecimalField(max_digits=12, decimal_places=3)
    spec_content = models.CharField(default='', max_length=255, blank=True, null=True)
    service_content = models.CharField(default='', max_length=255, blank=True, null=True)
    is_hot = models.IntegerField(default=0, blank=True, null=True)
    is_ban = models.IntegerField(default=0, blank=True, null=True)
    is_delete = models.PositiveIntegerField(default=0)
    create_time = models.DateTimeField(blank=True, null=True)
    order_count = models.IntegerField(default=0)
    sell_count = models.DecimalField(default=0, max_digits=12, decimal_places=3)
    discount_price = models.DecimalField(default=0, max_digits=16, decimal_places=2, blank=True, null=True)
    from_type = models.IntegerField(default=0, blank=True, null=True)
    state = models.IntegerField(default=0, blank=True, null=True)
    shoper_id = models.IntegerField(blank=True, null=True)
    ratio = models.FloatField(default=0, blank=True, null=True)
    discount_ratio = models.IntegerField(default=0, blank=True, null=True)
    is_community = models.IntegerField(default=0, blank=True, null=True)
    point_ratio = models.FloatField(default=0, blank=True, null=True)
    is_warehouse = models.IntegerField(default=0, blank=True, null=True)
    device_goods_id = models.CharField(default='', max_length=255, blank=True, null=True)
    cost_price = models.FloatField(default=0, blank=True, null=True)
    member_price = models.FloatField(default=0, blank=True, null=True)
    barcode = models.CharField(max_length=16, blank=True, null=True)
    py_code = models.CharField(default='', max_length=16, blank=True, null=True)
    updated = models.PositiveIntegerField()
    ver = models.PositiveIntegerField(default=0)
    pack_qty = models.PositiveIntegerField(default=0)
    assoc_goods_id = models.PositiveIntegerField(default=0)
    unit = models.CharField(default='', max_length=10, blank=True, null=True)
    guardian_ratio = models.FloatField(default=0, blank=True, null=True)
    spec_typ = models.PositiveIntegerField(default=0)
    scale_no = models.CharField(default='', max_length=10, blank=True, null=True)
    is_fast_food = models.PositiveIntegerField(default=0)
    product_date = models.DateField(default=None, blank=True, null=True)
    guarantee_period = models.IntegerField(default=0, blank=True, null=True)
    guarantee_type = models.IntegerField(default=0, blank=True, null=True)
    is_half = models.PositiveIntegerField(default=0)
    drink_spec = models.CharField(default='', max_length=255, blank=True, null=True)
    menu_desc = models.CharField(default='', max_length=255, blank=True, null=True)
    drink_flavorset = models.CharField(default='', max_length=255, blank=True, null=True)
    class Meta:
        managed = False
        db_table = 'table_goods'
